package br.com.rfqx.account.repository;

import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import br.com.rfqx.account.Customer;


@Repository
public interface CustomerRepository 
						extends AccountRepository<Customer> {

	List<Customer> findByCode(String code);
	
	List<Customer> findByCode(String code, Pageable pageable);
	
	@Query(name="listCustomers", value="select new Customer (c.id, c.name, c.code) from Customer c")
	List<Customer> listCustomers(Pageable pageable);
	
}
